package com.ruoyi.ai.mongo.repository;

import com.ruoyi.ai.mongo.pojo.ChatMessageDocument;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * 聊天消息MongoDB仓库
 *
 * @author coach tam
 * @email 327395128@qq.com
 * @values 坚持灵活 灵活坚持
 */
@Repository
public interface ChatMessageRepository extends ReactiveMongoRepository<ChatMessageDocument, String> {
    // 在ChatMessageRepository接口中添加此方法
    Flux<ChatMessageDocument> findByUserIdOrderByCreatedAtDesc(String userId);
}
